FROM 10.1.15.74:5000/zhiyuan_flagperf_ai_platform:v2.0

ENV CUDART_DUMMY_REGISTER=1
ENV XPU_DUMMY_EVENT=1

ENV XBLAS_FC_HBM_VERSION=40
ENV XPU_FORCE_CODE_PARAM_LOCATE_IN_L3=1
ENV XPU_FORCE_USERMODE_LAUNCH=1

ENV LD_LIBRARY_PATH=/usr/local/xpu/xre/so:/usr/local/xpu/xccl/so:$LD_LIBRARY_PATH
ENV XMLIR_FA_GEMM_TYPE=float16
ENV FAST_SWIGLU_ENABLE=1
ENV XDNN_FAST_DIV_SCALAR=true
ENV FAST_SUB_MN_M=true

ENV NCCL_SOCKET_IFNAME=ens21f0np0
ENV NCCL_IB_HCA=mlx5
ENV NCCL_IB_GID_INDEX=3

ENV BKCL_RDMA_PROXY_DISABLE=1
ENV BKCL_FLAT_RING=1
ENV BKCL_CCIX_RING=1
ENV BKCL_TREE_THRESHOLD=1
ENV BKCL_CCIX_BUFFER_GM=1
ENV BKCL_FORCE_L3_RDMA=1
ENV BKCL_RING_BUFFER_GM=1
ENV BKCL_ENABLE_XDR=1
ENV BKCL_RDMA_FORCE_TREE=1
ENV BKCL_TREE_THRESHOLD=1
ENV XPU_ZEBU_MODE=1
ENV BKCL_RDMA_NICS=ens11np0,ens11np0,ens13np0,ens13np0,ens15np0,ens15np0,ens17np0,ens17np0
ENV BKCL_XLINK_D2D=0
ENV BKCL_XLINK_C2C=1
ENV BKCL_XLINK_ETH=0
ENV BKCL_TRANS_UNSUPPORTED_DATATYPE=1
ENV BKCL_KL3_TURBO_MODE=1
ENV BKCL_RING_BUFFER_SIZE=2097152
ENV ALLREDUCE_ASYNC=false
ENV ALLGATHER_ASYNC=false
ENV ALLREDUCE_FUSION=0
ENV BKCL_TIMEOUT=360000
RUN unset BKCL_KL3_SYSCON_FLAG

RUN /bin/bash -c "git clone https://github.com/FlagOpen/FlagScale -b release/v0.2"
RUN /bin/bash -c "git clone https://github.com/FlagOpen/FlagPerf.git -b main"
